#################################################################################
#Title: The Democrat Disaster: Hurricane Exposure, Risk Aversion and Insurance Demand
#Author: Raluca L. Pahontu
#################################################################################


rm(list=ls())
library(RStata) 

options("RStata.StataVersion" = 14)
options("RStata.StataPath"= "/Applications/Stata/StataSE.app/Contents/MacOS/stata-se")

library(readstata13)
library(maps)
library(ggplot2)

library(ggcounty)
library(sf)
library("rnaturalearth")
library("rnaturalearthdata")
library(ggmap)
library(mapdata)

library(maptools)

library(foreign)
library(stringr)
library(scales)

library(tidyr)
library(dplyr)
library(zipcode)
library(stargazer)
library(coefplot)
library(sp)
library(ggrepel)
library(xtable)
setwd("~/Dropbox/Replication/JoP/")
options(warn=-1)


#-----------------------------------------
#-----------------------------------------

#           Main Text Figures

#-----------------------------------------
#-----------------------------------------

source("./code/2-fig1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 1
source("./code/27-fig3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 3
source("./code/28-fig4.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 4
source("./code/29-fig5.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 5
source("./code/4-fig6.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 6
#source("./code/12-fig7.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 7, uses data not publicly available


#-----------------------------------------
#-----------------------------------------

#      Supplementary Material Figures

#-----------------------------------------
#-----------------------------------------

source("./code/3-figa1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure A1
source("./code/5-fige1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure E1
source("./code/6-fige2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure E2
source("./code/7-fige3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure E3
source("./code/8-figd4.R", echo=TRUE, max.deparse.length=Inf) #Produces Figures D4
#source("./code/9-figd1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure D1, uses data not publicly available
#source("./code/10-figd2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure D2, uses data not publicly available
#source("./code/11-figd3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure D3, uses data not publicly available
source("./code/13-figc8.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C8
source("./code/14-tabc2.R", echo=TRUE, max.deparse.length=Inf) #Produces Table C2
source("./code/15-tabc3.R", echo=TRUE, max.deparse.length=Inf) #Produces Table C3
source("./code/16-figc1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C1
source("./code/17-figc2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C2
source("./code/18-figc3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C3
source("./code/19-figc4.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C4
source("./code/20-figc5.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C5
source("./code/21-figc6.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C6
source("./code/22-figc7.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C7
source("./code/23-figc9.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure C9
source("./code/24-figf1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure F1
source("./code/25-figf2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure F2
source("./code/26-figf3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure F3
source("./code/30-tabb10.R", echo=TRUE, max.deparse.length=Inf) #Produces Table B10
source("./code/31-figb5.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B5
source("./code/32-figb6.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B6
source("./code/33-figb7.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B7
source("./code/34-figb8.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B8
#source("./code/35-figb1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B1, uses data not publicly available
#source("./code/36-figb2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B2, uses data not publicly available
#source("./code/37-figb3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B3, uses data not publicly available
#source("./code/38-figb4.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B4, uses data not publicly available
source("./code/40-figg1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure G1
source("./code/39-figg2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure G2


